<!--
 * @Description: 
 * @version: 
 * @Author: 尹鹏孝
 * @Date: 2022-06-24 16:00:43
 * @LastEditors: 尹鹏孝
 * @LastEditTime: 2022-06-24 17:24:57
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>new的理解</title>
</head>
<body>
    <script>
        function Rabbit(lips){
            this.lips=lips;

        }
        let rit = new Rabbit('lipsTub');
        console.log('输出rit:',rit.lips);
        let leg = new Rabbit('legNew-------');
        console.log(leg.lips);
        //new干了什么？
        //1、创建一个空对象{}, //Object.create()
        //2、将空对象的原型指针指向构造函数的原型对象
        //3、利用构造函数的call改变this指向，在空对象上挂在属性和方法
        //4、返回对象
    </script>
</body>
</html>